package inteface.utils;

import java.io.File;
import javax.swing.filechooser.FileView;

/**
*  TERImageView.
* 
*  @author Vincent GUIJARRO
*  @version 0.2, 24/03/06
*/
/* ImageFileView.java is a 1.4 example used by FileChooserDemo2.java. */
public class TERImageView extends FileView {
    /*ImageIcon benchIcon = Utils.createImageIcon("images/benchIcon.gif");
    ImageIcon norIcon = Utils.createImageIcon("images/norIcon.gif");
    ImageIcon dataIcon = Utils.createImageIcon("images/dataIcon.gif");
    ImageIcon arffIcon = Utils.createImageIcon("images/arffIcon.gif");*/

    public String getName(File f) {
        return null; //let the L&F FileView figure this out
    }

    public String getDescription(File f) {
        return null; //let the L&F FileView figure this out
    }

    public Boolean isTraversable(File f) {
        return null; //let the L&F FileView figure this out
    }

    public String getTypeDescription(File f) {
        String extension = Utils.getExtension(f);
        String type = Utils.PNG;

        if (extension != null) {
            if (extension.equalsIgnoreCase(Utils.jpg) ||
            	extension.equalsIgnoreCase(Utils.jpeg)) {
                type = Utils.JPEG;
            } else if (extension.equalsIgnoreCase(Utils.png)){
                type = Utils.PNG;
            } else if (extension.equalsIgnoreCase(Utils.bmp)) {
                type = Utils.BMP;
            } else if (extension.equalsIgnoreCase(Utils.ps)) {
                type = Utils.PS;
            }
        }
        return type;
    }

    /*public Icon getIcon(File f) {
        String extension = Utils.getExtension(f);
        Icon icon = null;

        if (extension != null) {
            if (extension.equals(Utils.bench)) {
                icon = benchIcon;
            } else if (extension.equals(Utils.nor)) {
                icon = norIcon;
            } else if (extension.equals(Utils.data)) {
                icon = dataIcon;
            } else if (extension.equals(Utils.arff)) {
                icon = arffIcon;
            }
        }
        return icon;
    }*/
}
